Cap the values that Beta.random can generate.#3924
Merged
AlexAndorra merged 6 commits intopymc-devs:masterfrom May 15, 2020
Merged
Cap the values that Beta.random can generate.#3924AlexAndorra merged 6 commits intopymc-devs:masterfrom
AlexAndorra merged 6 commits intopymc-devs:masterfrom
Conversation
AlexAndorra
requested changes
May 15, 2020
Contributor
AlexAndorra
left a comment
There was a problem hiding this comment.
Thanks Luciano, LGTM! I just added some comments to correct typos -- will merge after this is fixed 💯
Member
Author
|
Thanks for the comments @AlexAndorra, I also fixed the failing test (at least locally). Should be ready to merge now. |
Codecov Report
@@ Coverage Diff @@
## master #3924 +/- ##
=======================================
Coverage 86.39% 86.40%
=======================================
Files 86 86
Lines 13722 13728 +6
=======================================
+ Hits 11855 11861 +6
Misses 1867 1867
|
AlexAndorra
approved these changes
May 15, 2020
Contributor
AlexAndorra
left a comment
There was a problem hiding this comment.
Thanks Luciano, looks all good, merging now :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3898.
To prevent beta random variates to be equal to 0 or 1, we cap the values to
np.nextafter(0,1, dtype)andnp.nextafter(1,0, dtype), which give the next floating point nearby zero and one respectively, depending on the precision of the floating point representation.Depending on what your PR does, here are a few things you might want to address in the description:
what are the (breaking) changes that this PR makes?
Samples returned by
Beta.randomcan never be equal to 0 or 1.important background, or details about the implementation
are the changes—especially new features—covered by tests and docstrings?
Yes
consider adding/updating relevant example notebooks
right before it's ready to merge, mention the PR in the RELEASE-NOTES.md